const Mock = require('mockjs')

const List4 = []
const count4 = 5
for (let i = 0; i < count4; i++) {
  List4.push(Mock.mock({
    id: '@id',
    test_time: '@datetime'
  }))
}

const data4 = Mock.mock({
  chip_id: '@id',
  name: '@title(5, 10)',
  supplier: '@title(1, 3)',
  chip_no: +Mock.Random.date('T'),
  raycus_no: +Mock.Random.date('T'),
  test_time: '@datetime',
  test_content: '@title(5, 10)',
  report_file_url: 'http://192.168.0.11/file/download/COS验证报告.xlxs',
  params: {
    chip_surface: [
      { pId: 1, item: '芯片外观', parameter: 'P面', symbol: 'P-side', unit: '/', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 2, item: '芯片外观', parameter: 'N面', symbol: 'N-side', unit: '/', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 3, item: '芯片外观', parameter: 'AR面', symbol: 'AR', unit: '/', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 3, item: '芯片外观', parameter: 'HR面', symbol: 'HR', unit: '/', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' }
    ],
    eutectic_quality: [
      { pId: 4, item: '共晶质量', parameter: '正面', symbol: 'Fr-profile', unit: '/', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 5, item: '共晶质量', parameter: '端面', symbol: 'He-profile', unit: '/', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 6, item: '共晶质量', parameter: '侧面', symbol: 'Si-profile', unit: '/', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' }
    ],
    photoelectric_parameter: [
      { pId: 7, item: '光电参数', parameter: '阈值电流', symbol: 'Ith', unit: 'A', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 8, item: '光电参数', parameter: '工作电流', symbol: 'Iop', unit: 'A', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '工作功率', symbol: 'Pop', unit: 'W', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '工作电压', symbol: 'Vop', unit: 'V', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '斜效率', symbol: 'η', unit: 'W/A', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '电光转换效率', symbol: 'ηtot', unit: '%', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '慢轴发散角', symbol: 'Θ‖', unit: '°', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '快轴发散角', symbol: 'Θ┴', unit: '°', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '光谱宽度', symbol: 'Δλ', unit: 'nm', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '工作波长', symbol: 'λ', unit: 'nm', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '波长差', symbol: 'Δλ5', unit: 'nm', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '慢轴光束质量BPP', symbol: 'BPP', unit: 'mm*mrad', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '偏振度', symbol: 'PER', unit: '%', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' }
    ],
    reliability_test: [
      { pId: 9, item: '可靠性测试', parameter: '工作电流', symbol: 'Iop', unit: 'A', test_condition: '30℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '可靠性测试', parameter: '工作功率', symbol: 'Pop', unit: 'W', test_condition: '30℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '可靠性测试', parameter: '功率差值', symbol: 'ΔP-TEM', unit: 'W', test_condition: '30℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '可靠性测试', parameter: '工作波长', symbol: 'λ', unit: 'nm', test_condition: '30℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '可靠性测试', parameter: '波长差', symbol: 'Δλ-TEM', unit: 'nm', test_condition: '30℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '可靠性测试', parameter: '工作电压', symbol: 'Vop', unit: 'V', test_condition: '30℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '可靠性测试', parameter: '波长差', symbol: 'ΔV-TEM', unit: 'V', test_condition: '30℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '可靠性测试', parameter: '热翻转电流', symbol: 'Irollover', unit: 'A', test_condition: '30℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '可靠性测试', parameter: '热饱和电流', symbol: 'Isaturation', unit: 'A', test_condition: '30℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '可靠性测试', parameter: '结温', symbol: 'Jct', unit: '℃', test_condition: '30℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 10, item: '可靠性测试', parameter: '热阻', symbol: 'Rth', unit: 'K/W', test_condition: '30℃', min_value: '0', typical_value: '5', max_value: '10' }
    ]
  }
})

module.exports = [
  {
    url: '/cos_report/history',
    type: 'get',
    response: config => {
      const { chipId } = config.query
      console.log('chipId', chipId)
      return {
        code: 0,
        data: List4
      }
    }
  },
  {
    url: '/cos_report/info',
    type: 'get',
    response: config => {
      const { testTime } = config.query
      console.log('testTime', testTime)
      return {
        code: 0,
        data: data4
      }
    }
  }
]

